
<style >
/* 模块1: 浅绿色 */
.el-table .module1-header {
  background-color: #f0f9eb !important;
}
.el-table .module1-cell {
  background-color: #f0f9eb;
}

/* 模块2: 浅橙色 */
.el-table .module2-header {
  background-color: #fdf6ec !important;
}
.el-table .module2-cell {
  background-color: #fdf6ec;
}

/* 模块3: 浅红色 */
.el-table .module3-header {
  background-color: #fef0f0 !important;
}
.el-table .module3-cell {
  background-color: #fef0f0;
}
</style>
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="日期" prop="dataDate">
        <el-date-picker
          clearable
          v-model="queryParams.dataDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model.trim="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
        <el-button
          :icon="!isOpen ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
          size="mini"
          @click="shouqi"
          >展开/收起</el-button
        >
      </el-form-item>

      <div v-if="isOpen">
        <el-form-item label="平台名称" prop="platformName">
          <el-input
            v-model.trim="queryParams.platformName"
            placeholder="请输入平台名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="店铺id" prop="shopId">
          <el-input
            v-model.trim="queryParams.shopId"
            placeholder="请输入店铺id"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="店铺名称" prop="shopName">
          <el-input
            v-model.trim="queryParams.shopName"
            placeholder="请输入店铺名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="售后费用_售后补偿消费者"
          prop="afterSaleCompensation"
        >
          <el-input
            v-model.trim="queryParams.afterSaleCompensation"
            placeholder="请输入售后费用_售后补偿消费者"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="售后费用_运费补偿"
          prop="afterSaleFeeShippingCompensation"
        >
          <el-input
            v-model.trim="queryParams.afterSaleFeeShippingCompensation"
            placeholder="请输入售后费用_运费补偿"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="售后费用小计" prop="totalAfterSalesCost">
          <el-input
            v-model.trim="queryParams.totalAfterSalesCost"
            placeholder="请输入售后费用小计"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="盈亏(发货口径估算)" prop="estimatedProfitLoss">
          <el-input
            v-model.trim="queryParams.estimatedProfitLoss"
            placeholder="请输入盈亏(发货口径估算)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="盈亏(GMV口径估算)" prop="estimatedGmv">
          <el-input
            v-model.trim="queryParams.estimatedGmv"
            placeholder="请输入盈亏(GMV口径估算)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="销售额" prop="salesAmount">
          <el-input
            v-model.trim="queryParams.salesAmount"
            placeholder="请输入销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="销售利润率" prop="salesProfitMargin">
          <el-input
            v-model.trim="queryParams.salesProfitMargin"
            placeholder="请输入销售利润率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="支付订单数" prop="orderPaymentCount">
          <el-input
            v-model.trim="queryParams.orderPaymentCount"
            placeholder="请输入支付订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="实际订单量" prop="actualOrderQuantity">
          <el-input
            v-model.trim="queryParams.actualOrderQuantity"
            placeholder="请输入实际订单量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="实际成交买家数" prop="actualBuyerCount">
          <el-input
            v-model.trim="queryParams.actualBuyerCount"
            placeholder="请输入实际成交买家数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="实际成交额" prop="actualTransactionAmount">
          <el-input
            v-model.trim="queryParams.actualTransactionAmount"
            placeholder="请输入实际成交额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="实际客单价" prop="actualAvgOrderValue">
          <el-input
            v-model.trim="queryParams.actualAvgOrderValue"
            placeholder="请输入实际客单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="店铺评分" prop="storeRating">
          <el-input
            v-model.trim="queryParams.storeRating"
            placeholder="请输入店铺评分"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="店铺访客数" prop="storeVisitorsCount">
          <el-input
            v-model.trim="queryParams.storeVisitorsCount"
            placeholder="请输入店铺访客数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成交买家数" prop="totalBuyersSold">
          <el-input
            v-model.trim="queryParams.totalBuyersSold"
            placeholder="请输入成交买家数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成交订单数" prop="totalOrderCount">
          <el-input
            v-model.trim="queryParams.totalOrderCount"
            placeholder="请输入成交订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成交金额" prop="totalAmount">
          <el-input
            v-model.trim="queryParams.totalAmount"
            placeholder="请输入成交金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="客单价" prop="customerAveragePrice">
          <el-input
            v-model.trim="queryParams.customerAveragePrice"
            placeholder="请输入客单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成功退款订单数" prop="successfulRefundOrderCount">
          <el-input
            v-model.trim="queryParams.successfulRefundOrderCount"
            placeholder="请输入成功退款订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成功退款金额" prop="successfulRefundAmount">
          <el-input
            v-model.trim="queryParams.successfulRefundAmount"
            placeholder="请输入成功退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="退款占比" prop="refundPercentage">
          <el-input
            v-model.trim="queryParams.refundPercentage"
            placeholder="请输入退款占比"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直通车退款费用" prop="refundFee">
          <el-input
            v-model.trim="queryParams.refundFee"
            placeholder="请输入直通车退款费用"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="总花费(元)" prop="totalCost">
          <el-input
            v-model.trim="queryParams.totalCost"
            placeholder="请输入总花费(元)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="交易额(元)" prop="tradingAmount">
          <el-input
            v-model.trim="queryParams.tradingAmount"
            placeholder="请输入交易额(元)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成交笔数" prop="totalTransactions">
          <el-input
            v-model.trim="queryParams.totalTransactions"
            placeholder="请输入成交笔数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成交笔数占比" prop="dealCountPercentage">
          <el-input
            v-model.trim="queryParams.dealCountPercentage"
            placeholder="请输入成交笔数占比"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="交易额占比" prop="tradeAmountPercentage">
          <el-input
            v-model.trim="queryParams.tradeAmountPercentage"
            placeholder="请输入交易额占比"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="小额礼品订单量" prop="smallGiftOrderQuantity">
          <el-input
            v-model.trim="queryParams.smallGiftOrderQuantity"
            placeholder="请输入小额礼品订单量"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="小额礼品买家数" prop="smallGiftBuyerCount">
          <el-input
            v-model.trim="queryParams.smallGiftBuyerCount"
            placeholder="请输入小额礼品买家数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="小额礼品订单金额" prop="smallGiftOrderAmount">
          <el-input
            v-model.trim="queryParams.smallGiftOrderAmount"
            placeholder="请输入小额礼品订单金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="小额礼品货品成本" prop="giftItemCost">
          <el-input
            v-model.trim="queryParams.giftItemCost"
            placeholder="请输入小额礼品货品成本"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="每单快递费
快递+包材"
          prop="totalShippingCost"
        >
          <el-input
            v-model.trim="queryParams.totalShippingCost"
            placeholder="请输入每单快递费
快递+包材"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="日快递总计
快递+包材"
          prop="totalDailyExpress"
        >
          <el-input
            v-model.trim="queryParams.totalDailyExpress"
            placeholder="请输入日快递总计
快递+包材"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="运费险" prop="shippingInsuranceFee">
          <el-input
            v-model.trim="queryParams.shippingInsuranceFee"
            placeholder="请输入运费险"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="平台综合扣点"
          prop="platformCombinedDeductionPoint"
        >
          <el-input
            v-model.trim="queryParams.platformCombinedDeductionPoint"
            placeholder="请输入平台综合扣点"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="其它费用支出" prop="otherExpenses">
          <el-input
            v-model.trim="queryParams.otherExpenses"
            placeholder="请输入其它费用支出"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="营销费用合计" prop="totalMarketingExpenses">
          <el-input
            v-model.trim="queryParams.totalMarketingExpenses"
            placeholder="请输入营销费用合计"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品数量(件)" prop="itemQuantity">
          <el-input
            v-model.trim="queryParams.itemQuantity"
            placeholder="请输入商品数量(件)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="货品总成本" prop="totalProductCost">
          <el-input
            v-model.trim="queryParams.totalProductCost"
            placeholder="请输入货品总成本"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="货品总成本占比" prop="productCostPercentage">
          <el-input
            v-model.trim="queryParams.productCostPercentage"
            placeholder="请输入货品总成本占比"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="毛利率" prop="grossProfitMargin">
          <el-input
            v-model.trim="queryParams.grossProfitMargin"
            placeholder="请输入毛利率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="售后费用_延迟发货"
          prop="afterSaleDelayedShippingCost"
        >
          <el-input
            v-model.trim="queryParams.afterSaleDelayedShippingCost"
            placeholder="请输入售后费用_延迟发货"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="售后费用_缺货" prop="afterSalesFeeStockOut">
          <el-input
            v-model.trim="queryParams.afterSalesFeeStockOut"
            placeholder="请输入售后费用_缺货"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="售后费用_虚假发货"
          prop="afterSaleFeeFalseShipment"
        >
          <el-input
            v-model.trim="queryParams.afterSaleFeeFalseShipment"
            placeholder="请输入售后费用_虚假发货"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <!-- <el-form-item label="逻辑删除" prop="isDelete">
          <el-input
            v-model.trim="queryParams.isDelete"
            placeholder="请输入逻辑删除"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item> -->
        <el-form-item
          label="售后费用_小额打款"
          prop="saleAfterServiceSmallAmountTransfer"
        >
          <el-input
            v-model.trim="queryParams.saleAfterServiceSmallAmountTransfer"
            placeholder="请输入售后费用_小额打款"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="成交UV价值" prop="totalUvValue">
          <el-input
            v-model.trim="queryParams.totalUvValue"
            placeholder="请输入成交UV价值"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="小额礼品佣金" prop="smallGiftCommission">
          <el-input
            v-model.trim="queryParams.smallGiftCommission"
            placeholder="请输入小额礼品佣金"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
      </div>
      <!-- <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item> -->
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['pdd:BiPddPerformanceDwd:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['pdd:BiPddPerformanceDwd:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['pdd:BiPddPerformanceDwd:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['pdd:BiPddPerformanceDwd:export']"
          >导出</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <uploadFile
          @handleSuccess="getList"
          :uploadUrl="'/pdd/BiPddPerformanceDwd/importData'"
        />
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="BiPddPerformanceDwdList"
      @selection-change="handleSelectionChange"
      :height="650"
    >
      <el-table-column type="selection" width="55" align="center" />
      <!-- 第一模块 -->
      <el-table-column
        label=""
        header-cell-class-name="module1-header"
        class-name="module1-cell"
        align="center"
      >
        <el-table-column label="id" align="center" prop="id" />
        <el-table-column label="日期" align="center" prop="dataDate">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.dataDate, "{y}-{m}-{d}") }}</span>
          </template>
        </el-table-column>
        <el-table-column label="项目名称" align="center" prop="projectName" />
        <el-table-column label="平台名称" align="center" prop="platformName" />
        <el-table-column
          width="160"
          label="店铺id"
          align="center"
          prop="shopId"
        />
        <el-table-column
          width="160"
          label="店铺名称"
          align="center"
          prop="shopName"
        />
      </el-table-column>
      <!-- 第二模块 -->
      <el-table-column
        label="实际成交数据(去刷去退)"
        header-cell-class-name="module2-header"
        class-name="module2-cell"
        align="center"
      >
        <el-table-column
          width="160"
          label="盈亏(发货口径估算)"
          align="center"
          prop="estimatedProfitLoss"
        />
        <el-table-column
          width="160"
          label="盈亏(GMV口径估算)"
          align="center"
          prop="estimatedGmv"
        />
        <el-table-column
          width="160"
          label="销售额"
          align="center"
          prop="salesAmount"
        />
        <el-table-column
          width="160"
          label="销售利润率"
          align="center"
          prop="salesProfitMargin"
        />
        <el-table-column
          width="160"
          label="支付订单数"
          align="center"
          prop="orderPaymentCount"
        />
      </el-table-column>

      <el-table-column label="实际交易数据(去刷不去退)" align="center">
        <el-table-column
          width="160"
          label="实际订单量"
          align="center"
          prop="actualOrderQuantity"
        />
        <el-table-column
          width="160"
          label="实际成交买家数"
          align="center"
          prop="actualBuyerCount"
        />
        <el-table-column
          width="160"
          label="实际成交额"
          align="center"
          prop="actualTransactionAmount"
        />
        <el-table-column
          width="160"
          label="实际客单价"
          align="center"
          prop="actualAvgOrderValue"
        />
      </el-table-column>
      <el-table-column label="基础数据" align="center">
        <el-table-column
          width="160"
          label="店铺评分"
          align="center"
          prop="storeRating"
        />
        <el-table-column
          width="160"
          label="店铺访客数"
          align="center"
          prop="storeVisitorsCount"
        />
        <el-table-column
          width="160"
          label="成交买家数"
          align="center"
          prop="totalBuyersSold"
        />
        <el-table-column
          width="160"
          label="成交订单数"
          align="center"
          prop="totalOrderCount"
        />
        <el-table-column
          width="160"
          label="成交金额"
          align="center"
          prop="totalAmount"
        />
        <el-table-column
          width="160"
          label="客单价"
          align="center"
          prop="customerAveragePrice"
        />
        <el-table-column
          width="160"
          label="成交UV价值"
          align="center"
          prop="totalUvValue"
        />
      </el-table-column>
      <el-table-column label="退款数据" align="center">
        <el-table-column
          width="160"
          label="成功退款订单数"
          align="center"
          prop="successfulRefundOrderCount"
        />
        <el-table-column
          width="160"
          label="成功退款金额"
          align="center"
          prop="successfulRefundAmount"
        />
        <el-table-column
          width="160"
          label="退款占比"
          align="center"
          prop="refundPercentage"
        />
        <el-table-column
          width="160"
          label="直通车退款费用"
          align="center"
          prop="refundFee"
        />
      </el-table-column>
      <el-table-column label="推广数据合计" align="center">
        <el-table-column
          width="160"
          label="总花费(元)"
          align="center"
          prop="totalCost"
        />
        <el-table-column
          width="160"
          label="交易额(元)"
          align="center"
          prop="tradingAmount"
        />
        <el-table-column
          width="160"
          label="成交笔数"
          align="center"
          prop="totalTransactions"
        />
        <el-table-column
          width="160"
          label="成交笔数占比"
          align="center"
          prop="dealCountPercentage"
        />
        <el-table-column
          width="160"
          label="交易额占比"
          align="center"
          prop="tradeAmountPercentage"
        />
      </el-table-column>
      <el-table-column label="小额礼品数据_SD及其它" align="center">
        <el-table-column
          width="160"
          label="小额礼品订单量"
          align="center"
          prop="smallGiftOrderQuantity"
        />
        <el-table-column
          width="160"
          label="小额礼品买家数"
          align="center"
          prop="smallGiftBuyerCount"
        />
        <el-table-column
          width="160"
          label="小额礼品订单金额"
          align="center"
          prop="smallGiftOrderAmount"
        />
        <el-table-column
          width="160"
          label="小额礼品货品成本"
          align="center"
          prop="giftItemCost"
        />
        <el-table-column
          width="160"
          label="小额礼品佣金"
          align="center"
          prop="smallGiftCommission"
        />
      </el-table-column>
      <el-table-column label="营销费用" align="center">
        <el-table-column
          width="160"
          label="每单快递费
快递+包材"
          align="center"
          prop="totalShippingCost"
        />
        <el-table-column
          width="160"
          label="日快递总计
快递+包材"
          align="center"
          prop="totalDailyExpress"
        />
        <el-table-column
          width="160"
          label="运费险"
          align="center"
          prop="shippingInsuranceFee"
        />
        <el-table-column
          width="160"
          label="平台综合扣点"
          align="center"
          prop="platformCombinedDeductionPoint"
        />
        <el-table-column
          width="160"
          label="其它费用支出"
          align="center"
          prop="otherExpenses"
        />
        <el-table-column
          width="160"
          label="营销费用合计"
          align="center"
          prop="totalMarketingExpenses"
        />
      </el-table-column>
      <el-table-column label="货品成本_按照定价模型自行预估" align="center">
        <el-table-column
          width="160"
          label="商品数量(件)"
          align="center"
          prop="itemQuantity"
        />
        <el-table-column
          width="160"
          label="货品总成本"
          align="center"
          prop="totalProductCost"
        />
        <el-table-column
          width="160"
          label="货品总成本占比"
          align="center"
          prop="productCostPercentage"
        />
        <el-table-column
          width="160"
          label="毛利率"
          align="center"
          prop="grossProfitMargin"
        />
      </el-table-column>
      <el-table-column label="售后费用" align="center">
        <el-table-column
          width="160"
          label="售后费用_延迟发货"
          align="center"
          prop="afterSaleDelayedShippingCost"
        />
        <el-table-column
          width="160"
          label="售后费用_缺货"
          align="center"
          prop="afterSalesFeeStockOut"
        />
        <el-table-column
          width="160"
          label="售后费用_虚假发货"
          align="center"
          prop="afterSaleFeeFalseShipment"
        />

        <el-table-column
          width="160"
          label="售后费用_小额打款"
          align="center"
          prop="saleAfterServiceSmallAmountTransfer"
        />
        <el-table-column
          width="180"
          label="售后费用_售后补偿消费者"
          align="center"
          prop="afterSaleCompensation"
        />
        <el-table-column
          width="160"
          label="售后费用_运费补偿"
          align="center"
          prop="afterSaleFeeShippingCompensation"
        />
        <el-table-column
          width="160"
          label="售后费用小计"
          align="center"
          prop="totalAfterSalesCost"
        />
      </el-table-column>
      <el-table-column label="" align="center">
        <!-- <el-table-column width="160" label="逻辑删除" align="center" prop="isDelete" /> -->
        <el-table-column
          width="160"
          label="备注"
          align="center"
          prop="remark"
        />
        <el-table-column
          width="160"
          label="操作"
          align="center"
          class-name="small-padding fixed-width"
        >
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['pdd:BiPddPerformanceDwd:edit']"
              >修改</el-button
            >
            <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['pdd:BiPddPerformanceDwd:remove']"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改拼多多业绩日报对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="日期" prop="dataDate">
          <el-date-picker
            clearable
            v-model="form.dataDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="项目名称" prop="projectName">
          <el-input
            v-model.trim="form.projectName"
            placeholder="请输入项目名称"
          />
        </el-form-item>
        <el-form-item label="平台名称" prop="platformName">
          <el-input
            v-model.trim="form.platformName"
            placeholder="请输入平台名称"
          />
        </el-form-item>
        <el-form-item label="店铺id" prop="shopId">
          <el-input v-model.trim="form.shopId" placeholder="请输入店铺id" />
        </el-form-item>
        <el-form-item label="店铺名称" prop="shopName">
          <el-input v-model.trim="form.shopName" placeholder="请输入店铺名称" />
        </el-form-item>
        <el-form-item
          label="售后费用_售后补偿消费者"
          prop="afterSaleCompensation"
        >
          <el-input
            v-model.trim="form.afterSaleCompensation"
            placeholder="请输入售后费用_售后补偿消费者"
          />
        </el-form-item>
        <el-form-item
          label="售后费用_运费补偿"
          prop="afterSaleFeeShippingCompensation"
        >
          <el-input
            v-model.trim="form.afterSaleFeeShippingCompensation"
            placeholder="请输入售后费用_运费补偿"
          />
        </el-form-item>
        <el-form-item label="售后费用小计" prop="totalAfterSalesCost">
          <el-input
            v-model.trim="form.totalAfterSalesCost"
            placeholder="请输入售后费用小计"
          />
        </el-form-item>
        <el-form-item label="盈亏(发货口径估算)" prop="estimatedProfitLoss">
          <el-input
            v-model.trim="form.estimatedProfitLoss"
            placeholder="请输入盈亏(发货口径估算)"
          />
        </el-form-item>
        <el-form-item label="盈亏(GMV口径估算)" prop="estimatedGmv">
          <el-input
            v-model.trim="form.estimatedGmv"
            placeholder="请输入盈亏(GMV口径估算)"
          />
        </el-form-item>
        <el-form-item label="销售额" prop="salesAmount">
          <el-input
            v-model.trim="form.salesAmount"
            placeholder="请输入销售额"
          />
        </el-form-item>
        <el-form-item label="销售利润率" prop="salesProfitMargin">
          <el-input
            v-model.trim="form.salesProfitMargin"
            placeholder="请输入销售利润率"
          />
        </el-form-item>
        <el-form-item label="支付订单数" prop="orderPaymentCount">
          <el-input
            v-model.trim="form.orderPaymentCount"
            placeholder="请输入支付订单数"
          />
        </el-form-item>
        <el-form-item label="实际订单量" prop="actualOrderQuantity">
          <el-input
            v-model.trim="form.actualOrderQuantity"
            placeholder="请输入实际订单量"
          />
        </el-form-item>
        <el-form-item label="实际成交买家数" prop="actualBuyerCount">
          <el-input
            v-model.trim="form.actualBuyerCount"
            placeholder="请输入实际成交买家数"
          />
        </el-form-item>
        <el-form-item label="实际成交额" prop="actualTransactionAmount">
          <el-input
            v-model.trim="form.actualTransactionAmount"
            placeholder="请输入实际成交额"
          />
        </el-form-item>
        <el-form-item label="实际客单价" prop="actualAvgOrderValue">
          <el-input
            v-model.trim="form.actualAvgOrderValue"
            placeholder="请输入实际客单价"
          />
        </el-form-item>
        <el-form-item label="店铺评分" prop="storeRating">
          <el-input
            v-model.trim="form.storeRating"
            placeholder="请输入店铺评分"
          />
        </el-form-item>
        <el-form-item label="店铺访客数" prop="storeVisitorsCount">
          <el-input
            v-model.trim="form.storeVisitorsCount"
            placeholder="请输入店铺访客数"
          />
        </el-form-item>
        <el-form-item label="成交买家数" prop="totalBuyersSold">
          <el-input
            v-model.trim="form.totalBuyersSold"
            placeholder="请输入成交买家数"
          />
        </el-form-item>
        <el-form-item label="成交订单数" prop="totalOrderCount">
          <el-input
            v-model.trim="form.totalOrderCount"
            placeholder="请输入成交订单数"
          />
        </el-form-item>
        <el-form-item label="成交金额" prop="totalAmount">
          <el-input
            v-model.trim="form.totalAmount"
            placeholder="请输入成交金额"
          />
        </el-form-item>
        <el-form-item label="客单价" prop="customerAveragePrice">
          <el-input
            v-model.trim="form.customerAveragePrice"
            placeholder="请输入客单价"
          />
        </el-form-item>
        <el-form-item label="成功退款订单数" prop="successfulRefundOrderCount">
          <el-input
            v-model.trim="form.successfulRefundOrderCount"
            placeholder="请输入成功退款订单数"
          />
        </el-form-item>
        <el-form-item label="成功退款金额" prop="successfulRefundAmount">
          <el-input
            v-model.trim="form.successfulRefundAmount"
            placeholder="请输入成功退款金额"
          />
        </el-form-item>
        <el-form-item label="退款占比" prop="refundPercentage">
          <el-input
            v-model.trim="form.refundPercentage"
            placeholder="请输入退款占比"
          />
        </el-form-item>
        <el-form-item label="直通车退款费用" prop="refundFee">
          <el-input
            v-model.trim="form.refundFee"
            placeholder="请输入直通车退款费用"
          />
        </el-form-item>
        <el-form-item label="总花费(元)" prop="totalCost">
          <el-input
            v-model.trim="form.totalCost"
            placeholder="请输入总花费(元)"
          />
        </el-form-item>
        <el-form-item label="交易额(元)" prop="tradingAmount">
          <el-input
            v-model.trim="form.tradingAmount"
            placeholder="请输入交易额(元)"
          />
        </el-form-item>
        <el-form-item label="成交笔数" prop="totalTransactions">
          <el-input
            v-model.trim="form.totalTransactions"
            placeholder="请输入成交笔数"
          />
        </el-form-item>
        <el-form-item label="成交笔数占比" prop="dealCountPercentage">
          <el-input
            v-model.trim="form.dealCountPercentage"
            placeholder="请输入成交笔数占比"
          />
        </el-form-item>
        <el-form-item label="交易额占比" prop="tradeAmountPercentage">
          <el-input
            v-model.trim="form.tradeAmountPercentage"
            placeholder="请输入交易额占比"
          />
        </el-form-item>
        <el-form-item label="小额礼品订单量" prop="smallGiftOrderQuantity">
          <el-input
            v-model.trim="form.smallGiftOrderQuantity"
            placeholder="请输入小额礼品订单量"
          />
        </el-form-item>
        <el-form-item label="小额礼品买家数" prop="smallGiftBuyerCount">
          <el-input
            v-model.trim="form.smallGiftBuyerCount"
            placeholder="请输入小额礼品买家数"
          />
        </el-form-item>
        <el-form-item label="小额礼品订单金额" prop="smallGiftOrderAmount">
          <el-input
            v-model.trim="form.smallGiftOrderAmount"
            placeholder="请输入小额礼品订单金额"
          />
        </el-form-item>
        <el-form-item label="小额礼品货品成本" prop="giftItemCost">
          <el-input
            v-model.trim="form.giftItemCost"
            placeholder="请输入小额礼品货品成本"
          />
        </el-form-item>
        <el-form-item
          label="每单快递费
快递+包材"
          prop="totalShippingCost"
        >
          <el-input
            v-model.trim="form.totalShippingCost"
            placeholder="请输入每单快递费
快递+包材"
          />
        </el-form-item>
        <el-form-item
          label="日快递总计
快递+包材"
          prop="totalDailyExpress"
        >
          <el-input
            v-model.trim="form.totalDailyExpress"
            placeholder="请输入日快递总计
快递+包材"
          />
        </el-form-item>
        <el-form-item label="运费险" prop="shippingInsuranceFee">
          <el-input
            v-model.trim="form.shippingInsuranceFee"
            placeholder="请输入运费险"
          />
        </el-form-item>
        <el-form-item
          label="平台综合扣点"
          prop="platformCombinedDeductionPoint"
        >
          <el-input
            v-model.trim="form.platformCombinedDeductionPoint"
            placeholder="请输入平台综合扣点"
          />
        </el-form-item>
        <el-form-item label="其它费用支出" prop="otherExpenses">
          <el-input
            v-model.trim="form.otherExpenses"
            placeholder="请输入其它费用支出"
          />
        </el-form-item>
        <el-form-item label="营销费用合计" prop="totalMarketingExpenses">
          <el-input
            v-model.trim="form.totalMarketingExpenses"
            placeholder="请输入营销费用合计"
          />
        </el-form-item>
        <el-form-item label="商品数量(件)" prop="itemQuantity">
          <el-input
            v-model.trim="form.itemQuantity"
            placeholder="请输入商品数量(件)"
          />
        </el-form-item>
        <el-form-item label="货品总成本" prop="totalProductCost">
          <el-input
            v-model.trim="form.totalProductCost"
            placeholder="请输入货品总成本"
          />
        </el-form-item>
        <el-form-item label="货品总成本占比" prop="productCostPercentage">
          <el-input
            v-model.trim="form.productCostPercentage"
            placeholder="请输入货品总成本占比"
          />
        </el-form-item>
        <el-form-item label="毛利率" prop="grossProfitMargin">
          <el-input
            v-model.trim="form.grossProfitMargin"
            placeholder="请输入毛利率"
          />
        </el-form-item>
        <el-form-item
          label="售后费用_延迟发货"
          prop="afterSaleDelayedShippingCost"
        >
          <el-input
            v-model.trim="form.afterSaleDelayedShippingCost"
            placeholder="请输入售后费用_延迟发货"
          />
        </el-form-item>
        <el-form-item label="售后费用_缺货" prop="afterSalesFeeStockOut">
          <el-input
            v-model.trim="form.afterSalesFeeStockOut"
            placeholder="请输入售后费用_缺货"
          />
        </el-form-item>
        <el-form-item
          label="售后费用_虚假发货"
          prop="afterSaleFeeFalseShipment"
        >
          <el-input
            v-model.trim="form.afterSaleFeeFalseShipment"
            placeholder="请输入售后费用_虚假发货"
          />
        </el-form-item>
        <!-- <el-form-item label="逻辑删除" prop="isDelete">
          <el-input v-model.trim="form.isDelete" placeholder="请输入逻辑删除" />
        </el-form-item> -->
        <el-form-item label="备注" prop="remark">
          <el-input v-model.trim="form.remark" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item
          label="售后费用_小额打款"
          prop="saleAfterServiceSmallAmountTransfer"
        >
          <el-input
            v-model.trim="form.saleAfterServiceSmallAmountTransfer"
            placeholder="请输入售后费用_小额打款"
          />
        </el-form-item>
        <el-form-item label="成交UV价值" prop="totalUvValue">
          <el-input
            v-model.trim="form.totalUvValue"
            placeholder="请输入成交UV价值"
          />
        </el-form-item>
        <el-form-item label="小额礼品佣金" prop="smallGiftCommission">
          <el-input
            v-model.trim="form.smallGiftCommission"
            placeholder="请输入小额礼品佣金"
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listBiPddPerformanceDwd,
  getBiPddPerformanceDwd,
  delBiPddPerformanceDwd,
  addBiPddPerformanceDwd,
  updateBiPddPerformanceDwd,
} from "@/api/pdd/BiPddPerformanceDwd";

export default {
  name: "BiPddPerformanceDwd",
  data() {
    return {
      isOpen: false,
      inputValue: "",
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 拼多多业绩日报表格数据
      BiPddPerformanceDwdList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        dataDate: null,
        projectName: null,
        platformName: null,
        shopId: null,
        shopName: null,
        afterSaleCompensation: null,
        afterSaleFeeShippingCompensation: null,
        totalAfterSalesCost: null,
        estimatedProfitLoss: null,
        estimatedGmv: null,
        salesAmount: null,
        salesProfitMargin: null,
        orderPaymentCount: null,
        actualOrderQuantity: null,
        actualBuyerCount: null,
        actualTransactionAmount: null,
        actualAvgOrderValue: null,
        storeRating: null,
        storeVisitorsCount: null,
        totalBuyersSold: null,
        totalOrderCount: null,
        totalAmount: null,
        customerAveragePrice: null,
        successfulRefundOrderCount: null,
        successfulRefundAmount: null,
        refundPercentage: null,
        refundFee: null,
        totalCost: null,
        tradingAmount: null,
        totalTransactions: null,
        dealCountPercentage: null,
        tradeAmountPercentage: null,
        smallGiftOrderQuantity: null,
        smallGiftBuyerCount: null,
        smallGiftOrderAmount: null,
        giftItemCost: null,
        totalShippingCost: null,
        totalDailyExpress: null,
        shippingInsuranceFee: null,
        platformCombinedDeductionPoint: null,
        otherExpenses: null,
        totalMarketingExpenses: null,
        itemQuantity: null,
        totalProductCost: null,
        productCostPercentage: null,
        grossProfitMargin: null,
        afterSaleDelayedShippingCost: null,
        afterSalesFeeStockOut: null,
        afterSaleFeeFalseShipment: null,
        isDelete: null,
        saleAfterServiceSmallAmountTransfer: null,
        totalUvValue: null,
        smallGiftCommission: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    //搜索栏展示与收起
    shouqi() {
      // console.log(1);
      this.isOpen = !this.isOpen;
    },
    /** 查询拼多多业绩日报列表 */
    getList() {
      this.loading = true;
      listBiPddPerformanceDwd(this.queryParams).then((response) => {
        this.BiPddPerformanceDwdList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        dataDate: null,
        projectName: null,
        platformName: null,
        shopId: null,
        shopName: null,
        afterSaleCompensation: null,
        afterSaleFeeShippingCompensation: null,
        totalAfterSalesCost: null,
        estimatedProfitLoss: null,
        estimatedGmv: null,
        salesAmount: null,
        salesProfitMargin: null,
        orderPaymentCount: null,
        actualOrderQuantity: null,
        actualBuyerCount: null,
        actualTransactionAmount: null,
        actualAvgOrderValue: null,
        storeRating: null,
        storeVisitorsCount: null,
        totalBuyersSold: null,
        totalOrderCount: null,
        totalAmount: null,
        customerAveragePrice: null,
        successfulRefundOrderCount: null,
        successfulRefundAmount: null,
        refundPercentage: null,
        refundFee: null,
        totalCost: null,
        tradingAmount: null,
        totalTransactions: null,
        dealCountPercentage: null,
        tradeAmountPercentage: null,
        smallGiftOrderQuantity: null,
        smallGiftBuyerCount: null,
        smallGiftOrderAmount: null,
        giftItemCost: null,
        totalShippingCost: null,
        totalDailyExpress: null,
        shippingInsuranceFee: null,
        platformCombinedDeductionPoint: null,
        otherExpenses: null,
        totalMarketingExpenses: null,
        itemQuantity: null,
        totalProductCost: null,
        productCostPercentage: null,
        grossProfitMargin: null,
        afterSaleDelayedShippingCost: null,
        afterSalesFeeStockOut: null,
        afterSaleFeeFalseShipment: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isDelete: null,
        remark: null,
        saleAfterServiceSmallAmountTransfer: null,
        totalUvValue: null,
        smallGiftCommission: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加拼多多业绩日报";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getBiPddPerformanceDwd(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改拼多多业绩日报";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updateBiPddPerformanceDwd(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBiPddPerformanceDwd(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除拼多多业绩日报编号为"' + ids + '"的数据项？')
        .then(function () {
          return delBiPddPerformanceDwd(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "pdd/BiPddPerformanceDwd/export",
        {
          ...this.queryParams,
        },
        `BiPddPerformanceDwd_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
